package com.neuedu.his.mapper;

import com.neuedu.his.po.Disease;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author root
 * @description 针对表【disease】的数据库操作Mapper
 * @createDate 2025-06-25 10:55:54
 * @Entity com.neuedu.his.po.Disease
 */
public interface DiseaseMapper extends BaseMapper<Disease> {

    @Select("<script>" +
            "SELECT * FROM disease WHERE DelMark = 1 " +
            "<if test='keyword != null and keyword != \"\"'>" +
            "AND (DiseaseName LIKE CONCAT('%', #{keyword}, '%') " +
            "OR DiseaseCode LIKE CONCAT('%', #{keyword}, '%'))" +
            "</if>" +
            "ORDER BY DiseaseName LIMIT 50" +
            "</script>")
    List<Disease> searchDiseases(@Param("keyword") String keyword);


}

